#include <iostream>
#include <string.h>
#include <algorithm>
using namespace std;

int main () {
    string in;
    // string s = "hello nowcoder";
    // cout << s.find_last_of(" ") << endl;
    // cout << s.substr(s.find_last_of(" ") + 1).length() << endl;

    while(getline(cin, in)) {
        cout << in.substr(in.find_last_of(" ") + 1).length() << endl;
    }
    return 0;
}